package jmlzz.example.com.imdemo.common;


import android.os.Handler;
import android.os.Looper;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

/**
 * Created by robert.luozizhao on 2018/3/8.
 */

public class ThreadMannager {

    public static Handler handler = new Handler(Looper.getMainLooper());

    public static ExecutorService executor = Executors.newSingleThreadExecutor();
//    public static ExecutorService executors = Executors.newFixedThreadPool(3);

    public static void post(Runnable runnable){
        executor.execute(runnable);
    }


    public static void postMainThread(Runnable runnable){
        handler.post(runnable);
    }

}
